/**
 * The code of this mod element is always locked.
 *
 * You can register new events in this class too.
 *
 * If you want to make a plain independent class, create it using
 * Project Browser -> New... and make sure to make the class
 * outside xiaochangsama.ancientkungfugeneration as this package is managed by MCreator.
 *
 * If you change workspace package, modid or prefix, you will need
 * to manually adapt this file to these changes or remake it.
 *
 * This class will be added in the mod root package.
*/
package xiaochangsama.ancientkungfugeneration;

import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.level.LevelAccessor;
import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent;
import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.event.world.BiomeLoadingEvent;
import net.minecraftforge.event.server.ServerStartingEvent;
import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.api.distmarker.Dist;


public class PlayerOnWalls {
	public static boolean down(LevelAccessor world, Entity entity) {
		if (entity == null)
			return false;
		return world.getBlockState(new BlockPos(entity.getX(), entity.getY(), entity.getZ())).isFaceSturdy(world, new BlockPos(entity.getX(), entity.getY(), entity.getZ()), Direction.DOWN);
	}
	public static boolean west(LevelAccessor world, Entity entity) {
		if (entity == null)
			return false;
		return world.getBlockState(new BlockPos(entity.getX(), entity.getY(), entity.getZ())).isFaceSturdy(world, new BlockPos(entity.getX(), entity.getY(), entity.getZ()), Direction.WEST);
	}
	public static boolean east(LevelAccessor world, Entity entity) {
		if (entity == null)
			return false;
		return world.getBlockState(new BlockPos(entity.getX(), entity.getY(), entity.getZ())).isFaceSturdy(world, new BlockPos(entity.getX(), entity.getY(), entity.getZ()), Direction.EAST);
	}
	public static boolean north(LevelAccessor world, Entity entity) {
		if (entity == null)
			return false;
		return world.getBlockState(new BlockPos(entity.getX(), entity.getY(), entity.getZ())).isFaceSturdy(world, new BlockPos(entity.getX(), entity.getY(), entity.getZ()), Direction.NORTH);
	}
	public static boolean south(LevelAccessor world, Entity entity) {
		if (entity == null)
			return false;
		return world.getBlockState(new BlockPos(entity.getX(), entity.getY(), entity.getZ())).isFaceSturdy(world, new BlockPos(entity.getX(), entity.getY(), entity.getZ()), Direction.SOUTH);
	}

}
